//
//  ProtocolPOP.swift
//  LeGou
//
//  Created by lxm on 2022/7/23.
//

import UIKit
import RxSwift

class ProtocolPOP: XMBaseView {

    //MARK: --------------------属性--------------------
    let disposeBag = DisposeBag()
    //MARK: --------------------UI控件--------------------
    
    @IBOutlet weak var agreeBtn: UIButton!
    
    @IBOutlet weak var rejectBtn: UIButton!
    
    var protocolAgreeBlock: (()->())?
    
    //MARK: --------------------生命周期--------------------
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI()
        bindAction()
        addConstraints()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        setUI()
        bindAction()
        addConstraints()
    }

    //MARK: --------------------UI--------------------
    func setUI() {
 
    }
    
    func addConstraints() {
     
    }
    
    //MARK: --------------------methods--------------------
    func bindAction() {
        
    }
    
    @IBAction func onRegisterProtocol(_ sender: Any) {
        CommonService.shared.goWeb(type: .registerProtocol)
    }
    
    @IBAction func onPravite(_ sender: Any) {
        CommonService.shared.goWeb(type: .privateProtocol)

    }
    
    @IBAction func onDisagree(_ sender: Any) {
        removeFromSuperview()
    }
    
    @IBAction func onAgree(_ sender: Any) {
        if let block = protocolAgreeBlock {
            block()
        }
        LoginService.shared.readProtocol()
        removeFromSuperview()
    }
    //MARK: --------------------delegate--------------------

}
